<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ include file="/WEB-INF/views/include/taglib.jsp"%>
<!DOCTYPE html>
<html lang="en">
	<head>
		<!-- header -->
		<%@ include file="/WEB-INF/views/include/header.jsp"%>
		<%--<script src="http://libs.baidu.com/jquery/1.9.0/jquery.js"></script>--%>

        <meta name="viewport" content="width=device-width, initial-scale=1.0" />
        <!-- basic styles -->
      <%--  <link href="https://cdn.bootcss.com/bootstrap/3.3.7/css/bootstrap.min.css" rel="stylesheet">--%>
        <link rel="stylesheet" href="<s:url value="/assets/dist/css/jzqk.css?v=20180531"></s:url>">

		<style>

        </style>
	</head>
    <body>
    <div class="page-content">
        <div class="zs-home">
            <!-- 导航栏 -->
            <ul class="nav nav-pills nav-theme jzqk-nav">
                <li class="active"><a href="#">意向项目</a></li>
                <li><a href="#">在谈项目</a></li>
                <li><a href="#">评审项目</a></li>
                <li><a href="#">签约项目</a></li>
                <li><a href="#">落地项目</a></li>
                <li><a href="#">审批项目</a></li>
                <li><a href="#">在建项目</a></li>
                <li><a href="#">投产项目</a></li>
            </ul>
            <!-- 负责项目 -->
            <div class="row">
                <div class="col-xs-12">
                    <div class="module" id="fuze-box">
                        <h3>负责项目</h3>
                        <div class="pull-left">
                            <button class="btn btn-sm btn-info" id="query">条件搜索</button>
                            <button class="btn btn-sm btn-default" id="edit" >项目修改</button>
                        </div>


                            <div class="row">
                                <div class="col-xs-12">

                                    <!-- PAGE CONTENT BEGINS -->
                                    <!-- jqGrid表格 -->
                                    <table id="gridTable"></table>
                                    <!-- jqGrid工具类 -->
                                    <div id="gridPager"></div>
                                    <!-- 查询对话框 -->
                                    <div style="display: none;">
                                        <div class="row" id="queryDialog"></div>
                                    </div>
                                    <!-- PAGE CONTENT ENDS -->
                                </div><!-- /.col -->
                            </div><!-- /.row -->


                    </div>
                </div>
            </div>
            <div class="row">
                <!-- 总完成 -->
                <div class="col-xs-6">

                        <div class="module">
                            <h3>5亿以上和以下项目投资额与项目数</h3>
                            <div id="jzqk-five-chart"></div>
                        </div>
                </div>
                <div class="col-xs-6">

                    <div class="module">
                        <h3>大项目、好项目与一般项目投资额与项目数</h3>
                        <div id="jzqk-dahao-chart"></div>
                    </div>
                </div>
            </div>
            <div class="row">
                <!-- 项目按行业分类 -->

                <div class="col-xs-12">

                       <div class="module middle">
                           <ul class="nav nav-pills nav-theme fdpm-nav">
                               <li class="active"><a href="javascript:void(0);">专业</a></li>
                               <li><a href="javascript:void(0);">乡镇</a></li>
                               <li><a href="javascript:void(0);">部门</a></li>

                           </ul>
                           <h3>分队个数排名</h3>
                           <div id="jzqk-xz-chart"></div>
                       </div>
                </div>
               <%-- <div class="col-xs-4">
                    <div class="module">
                        <h3>分队个数排名</h3>
                        <div id="jzqk-xz-chart2"></div>
                    </div>
                </div>
                <div class="col-xs-4">
                    <div class="module">
                        <h3>分队个数排名</h3>
                        <div id="jzqk-xz-chart3"></div>
                    </div>
                </div>--%>

            </div>
        </div>
    </div><!-- /.page-content -->
    </div>
    <a href="#" id="btn-scroll-up" class="btn-scroll-up btn btn-sm btn-inverse">
        <i class="ace-icon fa fa-angle-double-up icon-only bigger-110"></i>
    </a>
    <input id="project-stage" value="${projectStage}" style="display: none">


    <%@ include file="/WEB-INF/views/include/dialog.jsp" %>
    <%@ include file="/WEB-INF/views/include/footer.jsp" %>
    <script src="<s:url value="/assets/dist/js/echarts.min.js"></s:url>"></script>
    <%--<script src="<s:url value="/assets/dist/js/macarons.js"></s:url>?v=2"></script>--%>
    <script src="<s:url value="/assets/dist/js/jzqk.js"></s:url>?v=6"></script>
    <script type="text/javascript">
        //基本路径
        var baseUrl = "<s:url value="/show/details/detail"></s:url>/"

        //jqgrid的表格高度
        var height = 320;
        //jqgrid表格行头的中文
        var colNames = ['','年份','首申日期','小分队','项目名称','项目类别', '投资方名称', '项目内容和规模','项目进展情况','产业分类','具体分类','总投资',
            '项目阶段','企业属性','属地', '国别或地区','实际金额','实际个数','企业联系人','是否纳统','是否纳税'];
        //jqgrid表格中每一行的信息模型
        var colModel = [
            {name:'sysId', index:'sysId',width:180,editable: false,hidden:true, key:true},
            {name:'datatime',index:'datatime', width:50,editable: true},
            {name:'firstReportDate',index:'firstReportDate',width:90,editable:true},
            {name:'teamName',index:'teamName', width:160,editable: true},
            {name:'projectName',index:'projectName', width:220,editable: true},
            {name:'projectClass',index:'projectClass',width:120,editable:true},
            {name:'investorName',index:'investorName', width:230, editable: true},
            {name:'projectContent',index:'projectContent', width:200, editable: true},
            {name:'projectProgress',index:'projectProgress', width:200, editable: true},
            {name:'industrialClassfly',index:'industrialClassfly', width:80, editable: true},
            {name:'industrialConcrete',index:'industrialConcrete', width:100, editable: true},
            {name:'totalInver',index:'totalInver', width:60, editable: true},
            {name:'projectStage',index:'projectStage', width:70, editable: true},
            {name:'attribute',index:'attribute', width:70, editable: true},
            {name:'belongArea',index:'belongArea', width:100, editable: true},
            {name:'area',index:'area', width:140, editable: true},
            {name:'realInver',index:'realInver',width:150,editable:true},
            {name:'realNum',index:'realNum',width:150,editable:true},
            {name:'companyContacts',index:'companyContacts',width:180,editable:true},
            {name:'isnnu',index:'isnnu',width:80,editable:true,formatter:aa11Fmatter},
            {name:'isRatepay',index:'isRatepay',width:80,editable:true,formatter:aa11Fmatter},

        ];

        var projectStage = $("#project-stage").val();

        //jqgrid的具体执行方法
        jqgrid({
            shrinkToFit:false,
            gridTableId : "#gridTable",
            gridPagerId : "#gridPager",
            postData: {projectStage:projectStage},
            footerrow:true,
            userDataOnFooter:true,
            gridComplete:function () {
                var sumtotal =$("#gridTable").getCol('totalInver',false,'sum');
                var realnumsum=$("#gridTable").getCol('realNum',false,'sum');
                var realInvest=$("#gridTable").getCol('realInver',false,'sum');
               // console.log(sumtotal);
                $("#gridTable").footerData('set',{'totalInver':sumtotal,'realNum':realnumsum,'realInver':realInvest});
            },

        });

        //更新操作
        $("#edit").click(function() {
            showEditView();
        });

        //执行更新操作
        function edit() {
            executeSaveOrUpdate({
                formId: "#formDialog form",
                dialogId: "#formDialog",
                url: "/show/details/edit/",
                tableId: "#gridTable",
                successMessage: "更新成功",
                successTitle: '更新对话框',
                failMessage: '更新失败',
                failTitle: '消息对话框'
            });
        }

        function showEditView() {
            showEditDialog({
                tableId: "#gridTable",
                dialogTitle: "更新对话框",
                dialogUrl: "/show/details/edit/",
                dialogFoot: '<button type="button" class="btn btn-primary" onclick="edit()" id="updatebtn">更新</button>' +
                '<button type="button" class="btn btn-pink" onclick="reset()">重置</button>' +
                '<button type="button" class="btn btn-default" data-dismiss="modal">关闭</button>',
                errorTitle: "消息对话框",
                errorMutiSelectMessage: '您当前选中多行，请重新选择',
                errorUnSelectMessage: '您当前尚未选中一行，请选择后再试',
                errorOk: '确定'
            });
        }

        $("#gridTable").dblclick(function(e){
            showView();
        });

        //显示编辑对话框
        function showView() {
            showEditDialog({
                tableId: "#gridTable",
                dialogTitle: "更新对话框",
                dialogUrl:"/show/details/edit/",
                errorTitle: "消息对话框",
                errorMutiSelectMessage: '您当前选中多行，请重新选择',
                errorUnSelectMessage: '您当前尚未选中一行，请选择后再试',
                errorOk: '确定'
            });
        }




        //显示查询对话框
        var queryDialog = $("#queryDialog");
        $("#query").click(function() {
            showDialog({
                dialogTitle: '查询对话框',
                dialogBody: queryDialog,
                dialogFoot: "<button type='button' class='btn btn-primary' onclick='query()'>查询</button>" +
                "<button type='button' class='btn btn-pink' onclick='reset()'>重置</button>" +
                "<button type='button' class='btn btn-default' data-dismiss='modal'>关闭</button>"
            });
            var _projectStage = $("#project-stage").val();
            if(_projectStage == '') {
                _projectStage = '意向项目';
            }
            $('#projectStage').val(_projectStage);

        });

        //加载查询对话框
        $("#queryDialog").load(getUrl("filter"));

        //重置表单
        function reset() {
            resetForm("#formDialog form");
        }

        //具体查询方法
        function query() {
            seachJqgird("#gridTable","#formDialog form");
//            var _data = serializeObjectData('#formDialog form');
//            _data.projectStage = tempstage;
//            seachJqgirdData("#gridTable",_data);
            $("#formDialog").modal('hide');
            reset();
        }

        function aa11Fmatter(cellvalue,options,rowObject)
        {
            if(cellvalue=="0"){
                return "否";
            }else if(cellvalue=="1") {
                return "是";
            }else {
                return "";
            }
        }
    </script>
    </body>
</html>